Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 694e55befcf398d6b2806a723f72751c138bfec9


Parents : d2b8e4f
Author : Ivan <ivan@quad4.io>
Signature : Signature validation error
Date : 2026-05-03T22:00:43-05:00

refactor(NomadNetworkPage): improve logic for determining .mu page rendering and update related tests

Changes
Diff

diff --git a/meshchatx/src/frontend/components/nomadnetwork/NomadNetworkPage.vue b/meshchatx/src/frontend/components/nomadnetwork/NomadNetworkPage.vue
index 57fecb86..3140a425 100644
--- a/meshchatx/src/frontend/components/nomadnetwork/NomadNetworkPage.vue
+++ b/meshchatx/src/frontend/components/nomadnetwork/NomadNetworkPage.vue
@@ -151,7 +151,7 @@
</template>
<div
- v-if="wasmBundled && (nodePagePath || '').toLowerCase().endsWith('.mu')"
+ v-if="showMicronRendererInMobileMenu"
class="mt-2 pt-2 border-t border-[var(--mc-border-strong)] flex flex-col gap-1.5"
>
<div
@@ -757,13 +757,23 @@ export default {
}
return null;
},
- showMicronRendererInMobileMenu() {
- if (!this.wasmBundled || !this.selectedNode || !this.nodePagePath || this.isShowingNodePageSource) {
+ /**
+ * True when the loaded Nomad URL points at a .mu page. Strips Nomad ` suffix
+ * (e.g. /page/foo.mu`g=reticulum|...) so engine switching matches the renderer chip.
+ */
+ nodePagePathIsMicronMu() {
+ if (!this.nodePagePath) {
return false;
}
const [p] = this.nodePagePath.split("`");
return (p || "").toLowerCase().endsWith(".mu");
},
+ showMicronRendererInMobileMenu() {
+ if (!this.wasmBundled || !this.selectedNode || !this.nodePagePath || this.isShowingNodePageSource) {
+ return false;
+ }
+ return this.nodePagePathIsMicronMu;
+ },
blockedDestinations() {
return GlobalState.blockedDestinations;
},
@@ -916,7 +926,7 @@ export default {
this.$watch(
() => GlobalState.config?.nomad_micron_default_engine,
() => {
- if (this.nodePageContent && this.nodePagePath && this.nodePagePath.toLowerCase().endsWith(".mu")) {
+ if (this.nodePageContent && this.nodePagePathIsMicronMu) {
const content = this.nodePageContent;
this.nodePageContent = null;
this.$nextTick(() => {
@@ -1010,7 +1020,7 @@ export default {
try {
const cfg = await patchServerConfig({ nomad_micron_default_engine: next }, window.api);
mergeGlobalConfig(cfg);
- if (this.nodePageContent && this.nodePagePath && this.nodePagePath.toLowerCase().endsWith(".mu")) {
+ if (this.nodePageContent && this.nodePagePathIsMicronMu) {
const content = this.nodePageContent;
this.nodePageContent = null;
this.$nextTick(() => {

diff --git a/tests/frontend/NomadNetworkPage.test.js b/tests/frontend/NomadNetworkPage.test.js
index 93407a9d..0a23bcef 100644
--- a/tests/frontend/NomadNetworkPage.test.js
+++ b/tests/frontend/NomadNetworkPage.test.js
@@ -180,6 +180,19 @@ describe("NomadNetworkPage.vue", () => {
});
expect(wrapper.vm.showMicronRendererInMobileMenu).toBe(false);
});
+
+ it("is true on .mu page when URL has Nomad data suffix after backtick", async () => {
+ const dest = "e".repeat(32);
+ const wrapper = mountNomadNetworkPage();
+ await wrapper.setData({
+ wasmBundled: true,
+ selectedNode: { destination_hash: dest, display_name: "N" },
+ nodePagePath: `${dest}:/page/repo.mu\`g=reticulum|r=nomadnet`,
+ isShowingNodePageSource: false,
+ });
+ expect(wrapper.vm.nodePagePathIsMicronMu).toBe(true);
+ expect(wrapper.vm.showMicronRendererInMobileMenu).toBe(true);
+ });
});
describe("partials", () => {


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────